// pages/doctor-pay-record/doctor-pay-record.js
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    localImg: app.globalData.staticimgUrl,  // 本地图片
    pagenum: 1,
    pagesize: 10,
    list:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    app.showLoading();
    this.getListData();
  },
  getListData(){
    const that = this;
    const param = {
      pagenum: this.data.pagenum,
      pagesize: this.data.pagesize
    };
    app.request({
      url: "shopp/financeApi/queryPayList",
      data: param,
      success: function (res) {
        let list = res.data;
        if (param.pagenum != 1) {
          list = that.data.list.concat(list);
        }
        that.setData({
          list
        })
        wx.hideLoading();
      },
      fail: function (res) {
        // app.requestFail(res);
      }
    });
  },
  //加载更多
  moreInfo() {
    app.showLoading();
    let pagenum = this.data.pagenum + 1;
    this.setData({
      pagenum
    });
    this.getListData();
  }
})